package me.helllp.book.jvm.ch02;

import java.util.ArrayList;
import java.util.List;

/**
 * 产生堆内存不足异常
 * VM Args : -Xms20m -Xmx20m -XX:+HeapDumpOnOutOfMemoryError 
 * 
 * @author linxm
 *
 */
public class HeapOOM {
    static class OOMObject{
        
    }

    //	HeapDumpOnOutOfMemoryError 可以将堆信息Dump出来
    public static void main(String[] args) {
        List<OOMObject> list = new ArrayList<OOMObject>();
        
        for(;;){
            list.add(new OOMObject());
        }
    }
}